-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webaudio migration #6098
base: master
Are you sure you want to change the base?
Webaudio migration #6098
Conversation
@netpro2k I've tried to cover as many audio update cases as I could think of but I might be missing some. |
In if (
(audio.panner === undefined && settings.audioType === AudioType.PannerNode) ||
(audio.panner !== undefined && settings.audioType === AudioType.Stereo)
) {
el.emit("audio_type_changed");
} In the event handlers, we delete the three js Audio (or PositionalAudio) node and replace it with its counter part. And we do the same thing in When we control the web audio node graph directly, changing from Stereo to Panner does not require deleting resources -- just rewiring of the graph to go through (or not go through) a PannerNode. This also allows us to delete I thought this was one of the main motivations for making this change, so I am surprised to not see it in the diff. Are there plans to follow up with that change, or did I misunderstand the problem you're intending to solve? |
Good catch! I totally overlooked that case.
The main goal of this PR is:
Swapping audios is not a common case case, it only happens when you disable L/R panning so it doesn't really happen most of the time but now we can simplify that so that's a good side win. |
This PR migrates the client code from ThreeJS Audio to use the WebAudio API directly. This has a number of benefits:
The performance improvements added in this PR are:
In the quite common scenario where a few people are gathered not moving and listening to someone talking this translates into no audio updates.